package com.gitee.wsl.doc.prosemirror.state

import com.gitee.wsl.doc.prosemirror.plugin.StateField

class FieldDesc<T>(
    val name: String,
    val init: (config: EditorStateConfig, instance: EditorState) -> T,
    val apply: (tr: Transaction, value: T, oldState: EditorState, newState: EditorState) -> T
) {
    constructor(name: String, desc: StateField<T>) : this(
        name,
        desc::init,
        desc::apply
    )
}

